import { Injectable } from '@nestjs/common';
import { Repository } from 'typeorm';
import { InjectRepository } from '@nestjs/typeorm';
import { Report } from '@/entity/report/report.entiy';

@Injectable()
export class ReportService {
  constructor(
    @InjectRepository(Report)
    private reportRepository: Repository<Report>,
  ) {}
  async insertData(postParams: any): Promise<any> {
    return this.reportRepository.save(postParams)
  }

  async findReportByUserId(userId: string): Promise<Report[]> {
    return this.reportRepository.find({ where: { userId } });
  }
}
